<div ng-controller="homeCtrl">
    <div class="bg-light lter b-b wrapper-md">
        <h4 class="m-n font-thin">首页</h4>
    </div>
    <div class="panel-body">
        <div class="col-xs-9">
            <div class="padder-v">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="row row-sm text-center">
                            <div class="col-xs-3">
                                <div class="block panel padder-v bg-primary item">
                                    <span class="text-white font-thin h1 block" ng-if="header.totalCount != null">{{header.totalCount}}</span>
                                    <span class="text-white font-thin h1 block" ng-if="header.totalCount == null">0</span>
                                    <span class="text-white text-xs">门店数量</span>
                                </div>
                            </div>
                            <div class="col-xs-3">
                                <div class="panel padder-v item bg-danger">
                                    <span class="text-white font-thin h1 block" ng-if="header.totalOrders != null">{{header.totalOrders}}</span>
                                    <span class="text-white font-thin h1 block" ng-if="header.totalOrders == null">0</span>
                                    <span class="text-white text-xs">总下单数</span>
                                </div>
                            </div>
                            <div class="col-xs-3">
                                <div class="block panel padder-v bg-info item">
                                    <span class="text-white font-thin h1 block" ng-if="header.totalPay != null">{{header.totalPay}}</span>
                                    <span class="text-white font-thin h1 block" ng-if="header.totalPay == null">0</span>
                                    <span class="text-white text-xs">总支付单数</span>
                                </div>
                            </div>
                            <div class="col-xs-3">
                                <div class="panel padder-v bg-success item">
                                    <span class="text-white font-thin h1 block" ng-if="header.totalTransaction != null">{{header.totalTransaction}}</span>
                                    <span class="text-white font-thin h1 block" ng-if="header.totalTransaction == null">0.00</span>
                                    <span class="text-white text-xs">总交易额</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="widget-header widget-header-flat col-sm-12">
                    <div class="bottom text-left pull-left">
                        <h4><i class="icon-bar-chart text-info"></i>&nbsp;销售统计</h4>
                    </div>
                    <div class="pull-right">
                        <div class="inline">
                            <p class="inline">店铺:</p>
                            <div class="inline">
                                <select class="input-sm form-control" ng-model="homeTableVO.shopId" ng-change="changeShopId()">
                                    <option value="">全部店铺</option>
                                    <option ng-repeat="s in shop" value="{{s.id}}">{{s.name}}</option>
                                </select>
                            </div>
                        </div>
                        <div class="inline">
                            <p class="inline">年份:</p>
                            <div class="inline">
                                <select class="input-sm form-control" ng-model="homeTableVO.year" ng-options="item for item in years" ng-change="changeYear()">
                                </select>
                            </div>
                        </div>
                        <div class="inline">
                            <p class="inline">月份:</p>
                            <div class="inline">
                                <select class="input-sm form-control" ng-model="homeTableVO.month" ng-options="item for item in months" ng-change="changeMonth()">
                                </select>
                            </div>
                        </div>
                    </div>
                </div >
                <div class="row">
                    <div class="col-sm-12">
                        <div>
                            <line id="main" legend="legend" item="item" data="data" serie="serie"></line>
                        </div>
                    </div>
                </div>
                <div class="col-sm-12">
                    <div class="bottom text-left pull-left">
                        <h4><i class="icon-fire text-danger"></i>&nbsp;本月前10商品销量排行</h4>
                    </div>
                </div>
                <div class="table-responsive col-sm-12">
                    <table class="table table-striped b-t b-light fa-border">
                        <thead>
                            <tr>
                                <th>名称</th>
                                <th>销量</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-repeat="item in goods">
                                <td>{{item.name}}</td>
                                <td>{{item.totalCount}}</td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="text-center h6" ng-if="goods==null || goods.length<=0">
                        ~本月暂未销量纪录~
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-3  panel  wrapper" ng-if="income!=null && income.length>0">
            <div class="panel-heading bg-light padder-m">
                <h4>
                    <i class="glyphicon glyphicon-circle-arrow-up text-success"></i>&nbsp;&nbsp;门店销售额排名&nbsp;&nbsp;
                </h4>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <ul class="timeline">
                    <li class="tl-header">
                        <div class="btn btn-success">销冠</div>
                    </li>
                    <!-- 时间点 -->
                    <li class="tl-item tl-left" ng-repeat="item in income">
                        <div class="tl-wrap b-success">
                            <div class="tl-content panel padder b-a">
                                <span class="arrow left pull-up"></span>
                                <div class="text-lt inline">
                                    <span class="h5 font-bold">{{item.name}}：￥{{item.value | number:2}}</span>
                                </div>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>